(function ($) {
    $(document).ready(function () {
        function fertilizer_load (id,type,name,quantity,method,date,tableName) {
            var html ='<div class="fertilization-div '+id+'"><div class="fertilization-title">' +type+
                '<span class="fertilization-delete" onclick="delete_fertilizer(\''+tableName+'\',\''+id+'\')">-</span></div>' +
                '<ul><li>肥料名称:'+name+'</li>' +
                '<li>用量:'+quantity+'</li>' +
                '<li>施肥日期:'+date+'</li>' +
                '<li>施肥方法:'+method+'</li></ul></div>';
            jQuery('.fertilization-add-div').before(html);
        }
        $(".fertilizer-sub").each(function(){
            fertilizer_load($(this).attr("f_id"),
                $(this).attr("f_type"),
                $(this).attr("f_skuname"),
                $(this).attr("f_quantity"),
                $(this).attr("f_method"),
                $(this).attr("f_date"),
                $(this).attr("f_tablename"));
        });
    })
})(jQuery);